package com.zhongyu.hellocloudgradeconsumer.controller;

import com.zhongyu.hellocloudgradeconsumer.service.GradeServiceFeign;
import com.zhongyu.pojo.Grade;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class GradeController {

    @Resource
    private GradeServiceFeign gradeServiceFeign;

    @RequestMapping(value = "/grade/getList")
    public List<Grade> getGrades(){
        return  gradeServiceFeign.getGrades();
    }

    @RequestMapping(value = "/grade/getById")
    public Grade getGradeById(Integer id){
        return gradeServiceFeign.getGradeById(id);
    }

}
